package cn.wolfcode.qo;

import cn.hutool.core.date.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter
@Setter
public class NoticeQueryObject extends QueryObject {
    private Long level;
    private Long readstatus;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;

    public Date getBeginDate() {
        if (beginDate != null){
            return DateUtil.beginOfDay(beginDate);
        }
        return null;
    }
    public Date getEndDate() {
        if (endDate != null){
            return DateUtil.endOfDay(endDate);
        }
        return null;
    }

    //    public String getName() {
//        return AppointmentStatusEnum.findName(status);
//    }
}
